package com.qdc.datacenters.config;

import com.qdc.datacenters.utils.OsUtils;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * 系统配置
 * @author danmo
 * @date 2024-02-29 11:03
 **/
@Component
@Data
@ConfigurationProperties(prefix = "system.config")
public class SystemConfig {

    /**
     * 服务器地址端口
     */
    private String address;

    /**
     * 文件下载地址
     */
    private String downPath;


    public String getDownPath() {
        if (OsUtils.isWindows()) {
            return "C:/download/qdc/";
        }else if(OsUtils.isMac()){
            return "/Users/robin/work/qdc/";
        }
        return "/usr/local/qdc/file";
    }
}
